package com.example.tests;

public class ContactData implements Comparable<ContactData>{
	private String id;
	private String firstname;
	private String lastname;
	private String address_one;
	private String phonehome;
	private String phonemobile;
	private String work;
	private String mail_one;
	private String mail_two;
	public String birthDay;
	public String birthMonth;
	public String birthYear;
	private String address_two;
	private String home_two;

	public ContactData(){	
	}
	
	public ContactData(String firstname, String lastname, String address_one, String phonehome, String phonemobile, String work, 
		String mail_one, String mail_two, String birthDay, String birthMonth, String birthYear, String address_two, String home_two
			) {
		this.firstname = firstname;
		this.lastname = lastname;
		this.address_one =address_one;
		this.phonehome = phonehome;
		this.phonemobile = phonemobile;
		this.work = work;
		this.mail_one = mail_one;
		this.mail_two = mail_two;	
		this.birthDay = birthDay;
		this.birthMonth = birthMonth;
		this.birthYear = birthYear;
		this.address_two = address_two;
		this.home_two = home_two;	
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		//result = prime * result + ((firstname == null) ? 0 : firstname.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "ContactData [firstname=" + firstname + ", lastname=" + lastname
				+ ", address_one=" + address_one + ", phonehome=" + phonehome
				+ ", phonemobile=" + phonemobile + ", work=" + work
				+ ", mail_one=" + mail_one + ", mail_two=" + mail_two
				+ ", birthDay=" + birthDay + ", birthMonth=" + birthMonth
				+ ", birthYear=" + birthYear + ", address_two=" + address_two
				+ ", home_two=" + home_two + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (firstname == null) {
			if (other.firstname != null)
				return false;
		} else if (!firstname.equals(other.firstname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		return this.firstname.toLowerCase().compareTo(other.firstname.toLowerCase());
	}

	public ContactData withId(String id) {
		this.id = id;
		return this;
	}
	
	public ContactData withFirstname(String firstname) {
		this.firstname = firstname;
		return this;
	}

	public ContactData withLastname(String lastname) {
		this.lastname = lastname;
		return this;
	}

	public ContactData withAddressOne(String addressOne) {
		address_one = addressOne;
		return this;
	}

	public ContactData withPhonehome(String phonehome) {
		this.phonehome = phonehome;
		return this;
	}

	public ContactData withPhonemobile(String phonemobile) {
		this.phonemobile = phonemobile;
		return this;
	}

	public ContactData withWork(String work) {
		this.work = work;
		return this;
	}

	public ContactData withMailOne(String mailOne) {
		mail_one = mailOne;
		return this;
	}

	public ContactData withMailTwo(String mailTwo) {
		mail_two = mailTwo;
		return this;
	}

	public ContactData withAddressTwo(String addressTwo) {
		address_two = addressTwo;
		return this;
	}

	public ContactData withHomeTwo(String homeTwo) {
		home_two = homeTwo;
		return this;
	}

	public String getFirstname() {
		return firstname;
	}

	public String getId() {
		return id;
	}

	public String getLastname() {
		return lastname;
	}

	public String getAddress_one() {
		return address_one;
	}

	public String getPhonehome() {
		return phonehome;
	}

	public String getPhonemobile() {
		return phonemobile;
	}

	public String getWork() {
		return work;
	}

	public String getMail_one() {
		return mail_one;
	}

	public String getMail_two() {
		return mail_two;
	}

	public String getBirthDay() {
		return birthDay;
	}

	public String getBirthMonth() {
		return birthMonth;
	}

	public String getBirthYear() {
		return birthYear;
	}

	public String getAddress_two() {
		return address_two;
	}

	public String getHome_two() {
		return home_two;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public void setAddress_one(String address_one) {
		this.address_one = address_one;
	}

	public void setPhonehome(String phonehome) {
		this.phonehome = phonehome;
	}

	public void setPhonemobile(String phonemobile) {
		this.phonemobile = phonemobile;
	}

	public void setWork(String work) {
		this.work = work;
	}

	public void setMail_one(String mail_one) {
		this.mail_one = mail_one;
	}

	public void setMail_two(String mail_two) {
		this.mail_two = mail_two;
	}

	public void setBirthDay(String birthDay) {
		this.birthDay = birthDay;
	}

	public void setBirthMonth(String birthMonth) {
		this.birthMonth = birthMonth;
	}

	public void setBirthYear(String birthYear) {
		this.birthYear = birthYear;
	}

	public void setAddress_two(String address_two) {
		this.address_two = address_two;
	}

	public void setHome_two(String home_two) {
		this.home_two = home_two;
	}
	
}